//package cn.cxyxj.study01;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.NoOpPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.stereotype.Service;
//
//@Service
//public class UserDetailsServiceImpl implements UserDetailsService {
//   /* @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
//        UserDetails userDetails = User.withUsername("cxyxj")
//                .password("{noop}1234").authorities("admin").build();
//        return userDetails;
//    }*/
//
//
// /* @Bean
//    public PasswordEncoder passwordEncoder(){
//        return NoOpPasswordEncoder.getInstance();
//    }
//
//    @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
//        UserDetails userDetails = User.withUsername("cxyxj")
//                .password("1234").authorities("admin").build();
//        return userDetails;
//    }
//*/
//
//   /* @Bean
//    public PasswordEncoder passwordEncoder(){
//        // return NoOpPasswordEncoder.getInstance();
//        return new BCryptPasswordEncoder();
//    }
//
//    @Autowired
//    private PasswordEncoder passwordEncoder;
//
//    @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
//        String encode = passwordEncoder.encode("12345");
//        UserDetails userDetails = User.withUsername("cxyxj")
//                .password(encode).authorities("admin").build();
//        return userDetails;
//    }*/
//}
